package com.example.arithmeticleetcode.leetcode;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @program: arithmetic-leetcode
 * @description:
 * @author: FangZhen
 * @create: 2020-07-01 19:23
 **/
public class Demo37 {

    public static void main(String[] args) {
        System.out.println(kthFactor(12, 3));
        System.out.println(kthFactor(7, 2));
        System.out.println(kthFactor(4, 4));
        System.out.println(kthFactor(1, 1));
        System.out.println(kthFactor(1000, 3));
    }


    public static int kthFactor(int n, int k) {
        List<Integer> list = new ArrayList<>(n);
        for (int i = 1; i <= n; i++) {
            if (n % i == 0) {
                list.add(i);
            }
            if (list.size() == k) ;
        }
        return -1;
    }


}
